package com.itheima.dubbo.web;

import com.itheima.dubbo.Userface;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("user")
public class Usercontroller {

    // @DubboReference(timeout = 3000)
    //@DubboReference(retries = 2)
    @DubboReference(validation = "2.0.0")
    Userface userInterface;

    @GetMapping("hello")
    public String hello(String username) {
        /*try {
            Thread.sleep(5000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }*/
        return userInterface.hello(username);
    }


}
